call setpath.bat
set IOTYPE=uart
rem set IOTYPE=keyScreen

set HAVE_MATH=
rem set HAVE_MATH=-DHAVE_MATH=1

set HARD_MATH=
rem set HARD_MATH=-DHARD_MATH=1

if "%IOTYPE%"=="keyScreen" set KEYSCREEN=-DKEYSCREEN=1

"nios2-elf-gcc" -S -Os -DISBIOS=1 -DBIOSRAM=0x01F80000 inc/system.c -o system.s
"nios2-elf-gcc" -S -Os -DISBIOS=1 -DBIOSRAM=0x01F80000 inc/uart.c -o uart.s
rem "nios2-elf-gcc" -S -Os -DISBIOS=1 -DBIOSRAM=0x01F80000 inc/keyScreen.c -o keyScreen.s
"nios2-elf-gcc" -S -Os -DISBIOS=1 -DBIOSRAM=0x01F80000 %HAVE_MATH% %KEYSCREEN% inc/print.c -o print.s
rem "nios2-elf-gcc" -S -Os inc/Sd2Card.cpp -o Sd2Card.s
rem "nios2-elf-gcc" -S -Os inc/ch375b.cpp -o ch375b.s
rem "nios2-elf-gcc" -S -Os inc/FileSystem.cpp -o FileSystem.s
"nios2-elf-gcc" -S bios_simple.cpp -Os -o bios_simple.s
rem compile bios_simple.s,system.s,%IOTYPE%.s,print.s,Sd2Card.s,ch375b.s,FileSystem.s bios_simple.temp.s bios bios_simple.bin
compile bios_simple.s,system.s,%IOTYPE%.s,print.s bios_simple.temp.s bios bios_simple.bin
pause
